package com.onlineMIS.ORM.DAO.headQ.inventory;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.onlineMIS.ORM.DAO.BaseDAO;
import com.onlineMIS.ORM.entity.headQ.inventory.HeadQInventoryStore;
import com.onlineMIS.ORM.entity.headQ.inventory.InventoryOrder;
import com.onlineMIS.ORM.entity.headQ.inventory.InventoryOrderProduct;
import com.onlineMIS.common.loggerLocal;

@Repository
public class HeadQInventoryStoreDAOImpl extends BaseDAO<HeadQInventoryStore> {

	   public HeadQInventoryStore getDefaultStore() throws Exception{
		   List<HeadQInventoryStore> stores = getAll(true);
		   
		   if (stores.size() == 0) {
			   throw new Exception("没有初始化仓库信息 HeadqInventoryStore");
		   }
		   
		   return stores.get(0);
	   }

	   
	   public List<HeadQInventoryStore> getAllStores() throws Exception{
		   List<HeadQInventoryStore> stores = getAll(true);
		   
		   if (stores.size() == 0) {
			   throw new Exception("没有初始化仓库信息 HeadqInventoryStore");
		   }
		   
		   return stores;
	   }
}
